const mysql = require('mysql')
module.exports ={
	//数据库配置
	config:{
		host:'112.124.46.34',
		post:'3306',
		user:'expressAPI',
		password:'STJEADXBPC2GieAy',
		database:'expressAPI'
	},
	//连接数据库,使用连接池
	//连接池对象
	sqlConnect:function(sql,sqlArr,callBack){
		var pool = mysql.createPool(this.config)
		pool.getConnection((err,conn)=>{
			console.log('123')
			if(err){
				console.log('失败')
				return;
			}
			conn.query(sql,sqlArr,callBack);
			//释放连接
			conn.release()
		})
	}
}